package com.hgkj.system.async.task;


import com.hgkj.common.async.template.AsyncTask;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class AfterLoginAsyncTask implements AsyncTask {
    private final Long userId;

    private final String message;

    public AfterLoginAsyncTask(Long userId, String message) {
        this.userId = userId;
        this.message = message;
    }

    @Override
    public void execute() {
        log.info("开始执行异步任务demo");
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        log.info("用户ID:{} 消息:{}",userId,message);
    }
}
